{extend name="Public:base" /}

<!-- 标题 -->
{block name="title"}<title>系统配置</title>{/block}
<!-- 面包屑导航 -->
{block name="navigation"}
<section class="content-header">
	<h1>系统配置<small></small></h1>
	<ol class="breadcrumb">
		<li><a href="{:url('index/index')}"><i class="fa fa-dashboard"></i> 主页</a></li>
		<li class="active">角色管理</li>
	</ol>
</section>
{/block} 

<!-- 内容 -->
{block name="content"}
<!-- Custom Tabs -->
<div class="nav-tabs-custom">
	
	<ul class="nav nav-tabs">
		<li class="active"><a href="#tab_1" data-toggle="tab">系统配置</a></li>
		<li class="pull-right"><a href="#" class="text-muted" ><i class="fa fa-gear"></i></a></li>
	</ul>
	
	<div class="tab-content">
		<div class="tab-pane active" id="tab_1" style="max-width:800px;">
				
				<form role="form" action="{:url('config/saveconf')}" id="form-add">
					<input type="hidden" name="confName" value="site_config"/>
					 
					<div class="form-group">
						<label for="site_name">网站名称</label>
						<input type="text" class="form-control" id="site_name" name="site_name" value="{$conf.site_name}" autocomplete="off" placeholder="网站名称">
					</div>
					<div class="form-group">
						<label for="site_url">网站地址</label>
						<input type="text" class="form-control" id="site_url" name="site_url" value="{$conf.site_url}" autocomplete="off" placeholder="网站地址">
					</div>
					 
					<div class="form-group">
						<label for="site_qq">客服qq</label>
						<input type="text" class="form-control" id="site_qq" name="site_qq" value="{$conf.site_qq}" autocomplete="off" placeholder="客服qq">
					</div>
					
					 <div class="form-group">
						<label for="site_record">备案信息</label>
						<input type="text" class="form-control" id="site_record" name="site_record" value="{$conf.site_record}" autocomplete="off" placeholder="备案信息">
					</div>
					 <div class="form-group">
						<label for="site_email">站长邮箱</label>
						<input type="text" class="form-control" id="site_email" name="site_email" value="{$conf.site_email}" autocomplete="off" placeholder="站长邮箱">
					</div>
					<div class="form-group">
						<label for="site_right">版权信息</label>
						<input type="text" class="form-control" id="site_right" name="site_right" value="{$conf.site_right}" autocomplete="off" placeholder="版权信息">
					</div>
			  
					<div class="form-group">
						<label for="site_tel">公告信息</label>
						<textarea class="form-control" rows="3" name="notice">{$conf.notice}</textarea>
					</div>
					
					<div class="form-group">
						<label for="site_tel">统计代码</label>
						<textarea class="form-control" rows="3" name="site_tongji">{$conf.site_tongji}</textarea>
					</div>
					
					<button class="btn btn-success" type="submit">保存</button>	 
				</form>
			 
		  
		</div><!-- /.tab-pane -->
 
	</div><!-- /.tab-content -->
</div><!-- nav-tabs-custom -->
 

{/block}

<!-- js -->
{block name="js"}
 	
	<script type="text/javascript">
		$(function () {
		 
		});
  
		//表单提交
    	$(document)
	    	.ajaxStart(function(){
	    		$("button:submit").addClass("btn-default").removeClass('btn-primary').attr("disabled", true);
	    	})
	    	.ajaxStop(function(){
	    		$("button:submit").removeClass("btn-default").addClass("btn-primary").attr("disabled", false);
	    	});

    	$("form").submit(function(){
			 
    		var self = $(this);
    		$.post(self.attr("action"), self.serialize(), success, "json");
    		return false;

    		function success(data){
    			if(data.status){
    				layer.msg(data.msg, {
						icon:1,
						offset: 0,
						shift: 0,
						time:1500
					},function(){
						window.location.reload();//刷新当前页面 ;
					});
    			} else {
    				layer.msg(data.msg, {
						icon:0,
						offset: 0,
						shift: 6,
						time:1500
					}); 
    				 
    			}
    		}
    	});
	</script>

{/block}